Day 6 - Printing specific lines

24

$ sed -n 3,+5p slices.txt

This gives you the same output of the previous command, as it start at line 3, printing that and the

following 5 lines. Pay attention that sed is not showing you 5 lines starting from line 3, but 6 lines.

I think you probably still need you math skills.

Did you notice I haven’t given you any exercise last time? Yes you did, I’m sure. Well, no exercises

for this lesson either, just practice a bit printing lines and try to get used to the weird syntax.

Yesterday I gave you a headache with strange symbols, today I hope I just regained your trust. Let’s

wrap it up here, there is a new film that awaits you, and some crisps. Remember to put some beers

in the fridge, one for you, and one for your new friend sed. And maybe give some food to the cat

as well, poor little thing.

Suggested film for the evening: The Conversation (1974) - Sometimes getting a single line is not the

best choice, as this Unix programmer discovers while looking at conversationg logs.